﻿using UnityEngine;
using System.Collections;
using SGLib.Scene;
/// <summary>
/// 最简单的只加载场景的 SceneLoader
/// </summary>
public class NormalSceneLoader : BaseSceneLoader
{
    public string SceneName { get; protected set; }
    AsyncOperation loadSceneOperation;
    public NormalSceneLoader(string sceneName) 
    {
        this.SceneName = sceneName;
        loadSceneOperation = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(SceneName);
    }
    public override void OnStart()
    {
        base.OnStart();
    }
    public override void OnUpdate()
    {
        if (loadSceneOperation != null && loadSceneOperation.isDone)
        {
            this.OnFinish();
        }
    }
}
